package staticfactory;

/**
 * @author gaopeng
 * @date 2019/12/7 6:17 下午
 */
public class HumanFactory {
    public static <T extends Human> T createHuman(Class<T> tClass){
        Human human=null;
        try {
            human = tClass.newInstance();
        } catch (InstantiationException | IllegalAccessException e) {
            e.printStackTrace();
        }
        return (T) human;
    }
}
